<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>生产计划查询(点击编号查询)</title>
    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.css" rel="stylesheet">
    <link href="/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/bootstraptable/bootstrap-table.css" rel="stylesheet">
    <style>
        .text_no_border {
            border: none;
        }

        .text_bottom_border {
            border: none;
            border-bottom: 1px solid black;
        }
    </style>
</head>
<body>
<div style="color: #0e9aef;">您正在做的业务是：生产管理--生产计划管理--新发生生产计划审核</div>
<div class="container" style="margin-top: 20px">
    <form class="form-horizontal" id="production_plan_review_byId_form">
        <div>
            计划单编号：<span id="applyId"></span> 其中审核状态：<span id="checkTag"></span>
            <button type="button" class="btn btn-default col-md-offset-8" onclick="history.back(-1);">返回</button>
        </div>
        <div class="panel panel-default" style="margin-top: 5px;">
            <div class="page-heading">
                <div class="panel-title">
                    <h2 style="text-align: center;">生产计划单</h2>
                </div>
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">产品编号：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control text_no_border" readonly
                                   style="background-color: white" name="productId" id="productId"/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">产品名称：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control text_no_border" readonly
                                   style="background-color: white" name="productName" id="productName"/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">描述：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control text_no_border" readonly
                                   style="background-color: white" name="productDescribe" id="productDescribe"/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">数量：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control text_no_border" readonly
                                   style="background-color: white" name="amount" id="amount"/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-6">
                        <label class="control-label col-md-4">审核人：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control text_no_border" readonly style="background-color: white"
                                   name="checker" id="checker"/>
                        </div>
                    </div>
                    <div class="col-md-6">
                        <label class="control-label col-md-4">审核时间：</label>
                        <div class="col-md-8">
                            <input type="text" class="form-control text_no_border" readonly
                                   style="background-color: white" name="checkTime" id="checkTime"/>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-md-12">
                        <label class="col-md-2 control-label">备注：</label>
                        <div class="col-md-8">
                            <textarea class="form-control" rows="5" cols="60" style="resize: none" name="remark"
                                      id="remark"></textarea>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <input type="hidden" name="id" id="id">
    </form>
</div>


<!-- 全局js -->
<script src="/js/jquery.min.js?v=2.1.4"></script>
<script src="/js/bootstrap.min.js?v=3.3.6"></script>
<script src="/js/plugins/metisMenu/jquery.metisMenu.js"></script>
<script src="/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
<script src="/js/plugins/layer/layer.min.js"></script>

<!-- 自定义js -->
<script src="/js/hAdmin.js?v=4.1.0"></script>
<script src="/js/currentTime.js"></script>

<!-- 第三方插件 -->
<script src="/js/plugins/pace/pace.min.js"></script>

<!--BootstrapTable-->
<script src="/bootstraptable/bootstrap-table.min.js"></script>
<script src="/bootstraptable/locale/bootstrap-table-zh-CN.min.js"></script>


<script>
    $(function () {
        let auditId = localStorage.getItem("applyId")

        $.post("/manufacture/apply/getIdQueryApply", {"auditId": auditId}, function (res) {
            console.log(res)
            $("#production_plan_review_byId_form #id").val(res.id)
            if(res.checkTag=="S001-0"){
                $("#production_plan_review_byId_form #applyId").html(res.applyId).css("color","#eea236")
                $("#production_plan_review_byId_form #checkTag").html("等待").css("color","#eea236")
            }else if(res.checkTag=="S001-1"){
                $("#production_plan_review_byId_form #applyId").html(res.applyId).css("color","green")
                $("#production_plan_review_byId_form #checkTag").html("通过").css("color","green")
            }else {
                $("#production_plan_review_byId_form #applyId").html(res.applyId).css("color","red")
                $("#production_plan_review_byId_form #checkTag").html("未通过").css("color","red")
            }

            $("#production_plan_review_byId_form #productId").val(res.productId)
            $("#production_plan_review_byId_form #productName").val(res.productName)
            $("#production_plan_review_byId_form #checker").val(res.checker)
            $("#production_plan_review_byId_form #amount").val(res.amount)
            $("#production_plan_review_byId_form #remark").val(res.remark)
            if(res.checkTime!=null){
                $("#production_plan_review_byId_form #checkTime").val(formater(res.checkTime))
            }else {
                $("#production_plan_review_byId_form #checkTime").val("")
            }

        })

        $("#production_plan_review_byId_form #sure_btn").click(function () {
            let parms = $("#production_plan_review_byId_form").serialize()
            $.post("/manufacture/apply/applyReview", parms, function (res) {
                if (res) {
                    window.location = "production_plan_reviewUI"
                }
            })
        })
    })
</script>
</body>
</html>